<extend name="Base/base" />
<block name="button">
	
	<button class="btn btn-primary" type="submit" form="form"><i class="fa fa-save"></i> {:L('text_save')}</button>
</block>
<block name="body">
	<if condition="$msg">
		<div class="alert alert-danger alert-dismissible fade in" role="alert">
		      <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
		      {$msg.warning}

		    </div>
	</if>
	<div class="panel panel-default">
		<div class="panel-heading">
			<h4><i class="fa fa-pencil fa-fw"></i>  {$heading_title}</h4>
		</div>
		<div class="panel-body">
			<form action="" method="post" id="form" class="form-horizontal">
				<ul class="nav nav-tabs">
					<li class="active"><a href="#tab-general" data-toggle="tab">{:L('tab_general')}</a></li>
					<li><a href="#tab-text" data-toggle="tab">{:L('tab_text')}</a></li>
				</ul>
				<div class="tab-content">
					<div class="tab-pane active" id="tab-general">
						<div class="form-group required">
							<label for="input-key" class="col-sm-2 control-label">{:L('entry_key')}</label>
							<div class="col-sm-10">
								<input type="text" class="form-control" id="input-key" name="key" placeholder="{:L('entry_key')}" value="{$setting.key|default=''}">
								<if condition="isset($msg['key'])">
									{$msg.key|danger_msg}
								</if>
							</div>
								
						</div>
						<div class="form-group">
							<label for="input-type" class="col-sm-2 control-label">{:L('entry_type')}</label>
							<div class="col-sm-10">
								<select class="form-control" name="type" id="input-type">
									<foreach name="type" item="t" key="k">
										<option {:(isset($setting['type']) && $k==$setting['type'])?'selected':''} value="{$k}">{$t}</option>
									</foreach>
								</select>
							</div>								
						</div>
						<div class="form-group">
							<label for="input-setting-group" class="control-label col-sm-2">{:L('entry_group')}</label>
							<div class="col-sm-10">
								<select name="setting_group_id" id="input-setting-group" class="form-control">
									<foreach name="setting_group" item="group">
										<option {:(isset($setting['setting_group_id']) && $setting['setting_group_id']==$group['setting_group_id'])?'selected':''} value="{$group.setting_group_id}">{$group.title}</option>
									</foreach>
								</select>
							</div>
						</div>
						<div class="form-group">
							<label for="input-sort-order" class="col-sm-2 control-label">{:L('entry_sort_order')}</label>
							<div class="col-sm-10">
								<input type="number" value="{$setting.sort_order|default=''}" placeholder="{:L('entry_sort_order')}" name="sort_order" class="form-control" id="input-sort-order">
							</div>
						</div>
					</div>
					<div class="tab-pane" id="tab-text">
						<ul class="nav nav-tabs">
							<foreach name="languages" key="key" item="language">
								<li class="{$key?'':'active'}">
									<a href="#language{$language.language_id}" data-toggle="tab"><img src="__PUBLIC__/Images/flags/{$language.image}">  {$language.name}</a>
								</li>
							</foreach>
						</ul>
						<div class="tab-content">
							<foreach name="languages" key="key" item="language">
								<div class="tab-pane {$key?'':'active'}" id="language{$language.language_id}">
									<div class="form-group required">
										<label for="input-name{$language.language_id}" class="col-sm-2 control-label">{:L('entry_title')}</label>
										<div class="col-sm-10">
											<input id="input-name{$language.language_id}" type="text" value="{$setting['text'][$language['language_id']]['title']|default=''}" name="text[{$language.language_id}][title]" class="form-control" placeholder="{:L('entry_title')}">
											<if condition="isset($msg['title'][$language['language_id']])">
											{$msg['title'][$language['language_id']]|danger_msg=###}
											</if>
										</div>
									</div>
								</div>
							</foreach>
						</div>
					</div>
				</div>
				

						
			</form>
		</div>		
	</div>
</block>
